package com.nifostasky.comic.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.nifostasky.comic.entitys.SysOrgUnitRel;
import com.nifostasky.comic.mapper.SysOrgUnitRelMapper;
import com.nifostasky.comic.service.SysOrgUnitRelService;
import org.springframework.stereotype.Service;

import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

@Service
public class SysOrgUnitRelServiceImpl extends ServiceImpl<SysOrgUnitRelMapper, SysOrgUnitRel> implements SysOrgUnitRelService {

    @Override
    public Boolean deleteByUnitId(Long unitId) {
        LambdaQueryWrapper<SysOrgUnitRel> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(SysOrgUnitRel::getUnitId,unitId);
        return this.remove(queryWrapper);
    }

    @Override
    public List<SysOrgUnitRel> findListByUnitId(Long unitId) {
        LambdaQueryWrapper<SysOrgUnitRel> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(SysOrgUnitRel::getUnitId,unitId);
        return this.list(queryWrapper);
    }
}
